package com.agent.web;

import com.agent.entity.Dept;
import com.agent.entity.RepaireInfo;
import com.agent.page.EasyuiPage;
import com.agent.service.IDeptService;
import com.agent.util.ResponseData;
import com.agent.vo.RepaireInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * Created by hg on 2019/1/25.
 */
@Controller
@RequestMapping(value = "/dept")
public class DeptController {

    @Autowired
    IDeptService deptService;

    @RequestMapping(value = "/list/nopage",method = RequestMethod.GET)
    @ResponseBody
    public Map<String,Object> listNoPage(Dept dept){
        List<Dept> list = deptService.listNoPage(dept);
        Map<String,Object> result = ResponseData.getSuccessResult();
        result.put(ResponseData.DATA,list);
        return result;
    }

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    @ResponseBody
    public EasyuiPage list(Integer page, Integer rows, Dept dept){
        EasyuiPage<Dept> result = deptService.list(page, rows, dept);
        return result;
    }
}
